package local.bbs.common.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfig;

import freemarker.template.TemplateModel;

public class BaseController {
	
	@Autowired
	FreeMarkerConfig freeMarkerConfig;

	@ModelAttribute
	public void init(HttpServletRequest request, HttpServletResponse response) {
	}
	
	public TemplateModel getValue(String name) {
		return freeMarkerConfig.getConfiguration().getSharedVariable(name);
	}
	
}
